<template>
  <van-cell-group id="Score">
    <van-cell
      v-for="(item, index) in list"
      :key="index"
      disabled
      :title="item.nick_name"
      :label="item.telphone"
      :value="'视频：' + item.video_count + ' ' + '考试：' + item.exam_count"
    />
  </van-cell-group>
</template>

<script>
  import {Cell, CellGroup} from 'vant';

  export default {
    name: "ExamScore",
    components:{
      [Cell.name]: Cell,
      [CellGroup.name]: CellGroup,
    },
    data() {
      return {
        list: []
      }
    },
    methods: {
      getData() {
        let _this = this;
        let token = _this.getCookie("token");
        _this.$http.post(_this.apiUrl("user/exam/getScore"), {}, {
          headers: {
            'token': token,
            'sid': _this.$route.query.sid
          }
        })
          .then((res) => {
            // console.log(res.data);
            _this.list = res.data.data;
          });
      }
    },
    mounted() {
      let _this = this;
      _this.getData();
    }
  }
</script>

<style>
  #Score .van-cell__title, #Score .van-cell__value {
    flex: none;
  }

  #Score .van-cell__title {
    width: 50%;
  }

  #Score .van-cell__value {
    width: 50%;
  }
</style>
